package com.cqu.hhx.driver.mapper;

import com.cqu.hhx.driver.entity.FinishOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Date;
import java.util.List;

/**
 * @author DJ
 * @create 2020-05-25 10:45
 * 已完成订单
 */
@Mapper
public interface FinishOrderMapper {
    //新建订单
    public int addFinishOrder(FinishOrder order);
    //更新订单评价
    public int updateOrderEvaluation(@Param("customerId") Long customerId,
                                     @Param("orderId") Long orderId,
                                     @Param("evaluation") Float evaluation);
    //乘客获取订单
    public List<FinishOrder> customerGetOrder(@Param("customerId") Long customerId);
    //司机获取订单
    public List<FinishOrder> driverGetOrder(@Param("driverId") Long driverId);
    //管理员删除订单
    public int deleteOrder(@Param("orderId") Long orderId);
    //获取乘客已完成订单
    public List<FinishOrder> getCustomerFinishedOrder(@Param("selectedDay") Date selectedDay
            ,@Param("customerId") Long customerId);
    //获取司机已完成订单
    public List<FinishOrder> getDriverFinishedOrder(@Param("selectedDay") Date selectedDay
            ,@Param("driverId") Long driverId);
    //获取所有已完成订单
    public List<FinishOrder> getAllFinishedOrder(@Param("selectedDay") Date selectedDay);

}
